<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  $_SESSION['s_urlRedirectDir'] = $_SERVER['REQUEST_URI'];
  header("Location:checkLogin.php");
}
else
{
	$listArray = array();
	$i=0;
  $selectList = "SELECT partyName, toDate
                   FROM transaction
                   LEFT JOIN party ON party.partyid = transaction.partyid
                  WHERE toDate <= '".date("Y-m-d")."'
                    AND status = 'Y'
                 ORDER BY toDate DESC";
  $selectListRes = mysql_query($selectList);
  while($listRow = mysql_fetch_array($selectListRes))
  {
  	 $listArray[$i]['partyName'] = $listRow['partyName'];
  	 $listArray[$i]['toDate']    = $listRow['toDate'];
  	$i++;
  }
}
include("./bottom.php");
$smarty->assign('listArray',$listArray);
$smarty->display('list.tpl');
?>